﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CorporateGym.DAL;

namespace BLL
{
    public class ShiftsReport : IReport
    {
        public Dictionary<GymWorker, List<Shift>> shifts;
        
        public ShiftsReport()
        {
            shifts = new Dictionary<GymWorker, List<Shift>>();
        }

        public void Create(int i_Month, int i_Year)
        {
            foreach (var worker in GymWorkerManager.Instance.GetWorkers())
            {
                List<Shift> temp = new List<Shift>();
                
                foreach (var shift in GymWorkerManager.Instance.GetShifts(worker as GymWorker))
                {
                    Shift s = (shift as Shift);
                    if (s.StartingHour.Month == i_Month && s.StartingHour.Year == i_Year)
                    {
                        temp.Add((shift as Shift));
                    }
                }
                shifts.Add((worker as GymWorker), temp);
            }
        }
    }
}
